/**
@file connecttohost.cpp
@brief ConnectToHostDialog class methods implementation

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

@author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
@date 24 Jan 2009
*/
#include "connecttohostdialog.h"

#include <QtCore/QSettings>

#include "defaults.h"

using namespace mjn;

ConnectToHostDialog::ConnectToHostDialog(QWidget *parent): QDialog(parent) {
    setupUi(this);
    QSettings settings;
    quint16 port = settings.value("port",DEFAULT_PORT).value<quint16>();
    portEdit->setValue( port );
}

quint16 ConnectToHostDialog::port() const {
    if ( changePortCheckBox->checkState() == Qt::Unchecked ) {
        QSettings settings;
        return settings.value("port",DEFAULT_PORT).value<quint16>();
    }
    return portEdit->value();
}
